home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
476-500
/
497
/
back&front
/
toback&front.doc
< prev
next >
Wrap
Text File
|
1995-03-14
|
12KB
|
269 lines
toBack&Front
(Commodity)
by
Stefan Sticht
This program (binary), sourcecode, documentation is
PUBLIC DOMAIN.
You may do anything with it!
Purpose of this commodity:
--------------------------
toBack&Front is a commodity, with which you can easily switch the
window under the mouse pointer in front of all others or behind all
others. If the mousepointer is over an backdrop window or the
titlebar of a screen or no window, the screen is switched to front or
to back. For example you may install toBack&Front to bring any window
to front if you double-click in it. Or if you make three fast clicks,
so that this doesn't interfere with double-clicking an icon. You may
install it that double-clicking into a window while holding the left
alt key pressed switches the window to back. Which action switches a
window or screen to back or front is changeable. Most inputevents
(e.g. keyboard or mouse events) can be such an action.
Requirements:
-------------
This commodity requires at least Kickstart 37.* and Workbench 37.*.
Please check this out using Version in the Shell or About from the
Workbench's Workbench menu. You also need to have the
commodities.library in your libs: directory. Please check this out:
type "dir libs:" in the shell. If you want to trap other inputevents
than rawkey events, e.g. pressing of mouse buttons, you must have at
least commodities.library 37.27!
How to start a commodity:
-------------------------
First there are two basically different ways to start a commodity:
via Workbench or via Shell.
Starting it via Workbench is extrem simple: just doubleclick on
its icon and the commodity gets started. Perhaps you might change
some parameters of the commodity. You do this with tool types. Tool
types can be changed by clicking at the commodities icon and selecting
Information from the Workbench's Icon menu. In the window which opens
you see a listview gadget in which all tool types are listed. Please
refer to your Workbench documentation on how to change this tool
types. Which parameters you can change for this specific commodity is
described below.
Please note that another double click on the commodity's icon
forces the commodity to quit, if it's already running. Running two
copies of toBack&Front at the same time isn't useful and therefore
possible
To start a commodity via shell you type in its name. If you get
an "Unknown command ???" error message, you have misspelled the
commodity's name or the commodity isn't in your current directory or
in the current search path. The easiest way is to change your current
directory to the location of the commodity using the CD command. You
can change parameters of a commodity by command line options. The
available options are listed with ? as the first parameter:
toBack&Front ?
gives you a list of the command line options. The explanation of each
option is below. Starting the commodity once more while it is already
running forces it to quit.
If you want the commodity to be started at every boot-up, it's
best to add this line to your User-Startup file:
<path>toBack&Front <options>
Don't forget to replace <path> by the path to the commodities's
location and <options> by the options you want to change. For example
add this line if your commodity is located in the Tools drawer of your
boot disk:
Tools/toBack&Front
Another way to start the commodity at every boot-up is to drag its
icon in the WBStartup drawer of your boot disk. Then the commodity
gets started as if you had double clicked on its icon. But you have
to add the tool type DONOTWAIT to the icon.
Using Exchange:
---------------
Exchange is the commodities controller program. With Exchange you can
control all commodities: you can kill, disable, enable, show and hide
commodities.
Start the Exchange program, which usually is in the Utilities
drawer of your boot disk, by double clicking its icon. Now you see a
list of the available commodities. Select the commodity you want to
control. The commodities title, description and status is shown now
below the listview gadget.
You can kill the commodity using the Kill gadget... If the
commodity has a window to open, in which you usually change some
parameters, you can open this window using Show. Hide closes this
window. toBack&Front has no window to open.
Changeable parameters:
----------------------
CX_Priority:
------------
You can specify the priority of the Commodity within the commodities
queue using the tool type or commandline option CX_PRIORITY=<n>, where
<n> is the decimal value for the priority. Default priority is 0.
Front_Action:
-------------
With the tool type or commandline option FRONT_ACTION=<action> you
specify which action switches the window under the mouse pointer or
screen to front. <action> is an input description string as described
below. Default action is "FRONT_ACTION=rawmouse leftbutton
lbuttoncode" (left mousebutton).
Front_Clicks:
-------------
With the tool type or commandline option FRONT_CLICKS=<n> you specify
how many actions have to occur to switch something to front. Two
actions must always occur within the doubleclick-timeout, which you
can specify in the Input preferences. For example if you want a
window to be switched to front when double-clicking in it, you must
set Front_Action to trap the left mousebutton and set Front_clicks=2.
(This example is the default for front action!) If you want
triple-clicking, set Front_clicks=3 etc. Default is front_clicks=2.
Front_Remove:
-------------
With the tool type or commandline option FRONT_REMOVE=YES|NO you
specify wether the inputevent for the front action shall be removed
and therefore not being sent further to other programs. For example
setting front action to trap a double click and setting
front_remove=yes isn't useful, because any double-click will be eaten
by toBack&Front. Then you can't start any longer a program by
double-clicking on its icon. On the other hand it might be usefull to
remove the inputevent, for example if specify the action to be
pressing left alt and f once: if you don't set front_remove=yes then
pressing left alt and a while the mouse pointer is over an shell
window may write something in the window (depends on your keymap) and
switches it to front. If you set front_remove=yes, only the front
action takes place without writing something in any window. YES|NO
stands for "you may use either YES or NO, nothing else". Default is
FRONT_REMOVE=NO.
Back_Action:
------------
With the tool type or commandline option BACK_ACTION=<action> you
specify which action switches the window under the mouse pointer or
screen to back. <action> is an input description string as described
below. Default action is "FRONT_ACTION=rawmouse lalt leftbutton
lbuttoncode" (left mousebutton while pressing left alt key).
Back_Clicks:
------------
With the tool type or commandline option BACK_CLICKS=<n> you specify
how many actions have to occur to switch something to back. See
Front_Clicks for more information. Default is back_clicks=2.
Back_Remove:
------------
With the tool type or commandline option BACK_REMOVE=YES|NO you
specify wether the inputevent for the back action shall be removed and
therefore not being sent further to other programs. See Front_remove
for more information. Default is BACK_REMOVE=YES.
Input description strings
-------------------------
With input description strings you can specify almost any input
action, for example the action lshift f1, which means that pressing
the left shift and the f1 key together is the action. In this
commodity you can specify the action to open the commodity's window,
as described above.
Input description strings have the following template:
[class] (([-]qual)|syn)* [[-]upstroke] [highmap|ANSIcode]
(* means zero or more occurances of the of the expression in brackets)
class is one of the following strings:
rawkey, rawmouse, event, pointerpos, timer, newprefs,
diskremoved, diskinserted.
If not specified, the class is taken to be "rawkey".
qual is one of the strings:
lshift, rshift, capslock, control, lalt, ralt, lcommand,
rcommand, numericpad, repeat, midbutton, rbutton, leftbutton,
relativemouse
A preceding '-' means that the value of the corresponding
qualifier is to be considered irrelevant.
syn (synonym) is one of the strings: shift, caps, alt
shift means "left or right shift"
caps means "shift or capslock"
alt means "either alt key"
upstroke (literally "upstroke")
if this token is absent, only downstrokes are considered
for rawmouse (mousebuttons) and rawkey events. If it is
present alone, only upstrokes count. If it preceded by
'-' it means that both up and down strokes are included.
highmap one of the strings:
comma, space, backspace, tab, enter, return, esc, del, up, down,
right, left, help, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, (, ), /, *, -, +
lbuttoncode¹, mbuttoncode¹, rbuttoncode¹
ansicode a single character token is interpreted as a character code,
which is looked up in the system default keymap.
¹ these keywords aren't builtin in commodities.library upto version 37.27;
they are parsed by toBack&Front and can only be used in toBack&Front
Some full examples:
-------------------
Switch window to front when pressing left alt and f1, install no
back_action:
toback&Front "front_action=lalt f1" front_clicks=1 front_remove=yes
"back_action="
Switch window to front when clicking 3 times in the window with left
mouse button (left mouse button is already default!), switch to back
when double-clicking with middle mouse button (requires three button
mouse!):
toback&Front front_clicks=3 "back_action=rawmouse midbutton mbuttoncode"
back_clicks=2
Switch window to front when double-clicking in the window with left
mouse button (left mouse button is already default!) while pressing
left alt key, switch to back when double-clicking with left mouse
button while pressing left amiga key:
toback&Front "front_action=rawmouse lalt leftbutton lbuttoncode"
"back_action=rawmouse lcommand leftbutton lbuttoncode"
A funny example:
Switch window to front when inserting a disk in any drive, Switch
window to back when removing a disk from any drive:
toback&Front front_action=diskinserted front_clicks=1 front_remove=no
back_action=diskremoved back_clicks=1 back_remove=no
Send bug-reports, enhancement-requests, questions, gifts(!) to:
---------------------------------------------------------------
Stefan Sticht
Bibereckerweg 40a
D-8390 Passau 18
FRG
or (better) EMail to:
Internet: cbmvax.commodore.com!cbmehq!cbmger!edith!sticht@rutgers.EDU
or: IWSTICHT@ibm.rz.uni-passau.de
Fido-Net: Stefan Sticht (2:242/16)
Please include the version number of the commodity in every bug report
You get the version number using the Version command:
Version [<path>]<commodity>